// 箭头函数与this  

const person ={
    name: 'husky',
    sayHi: function(){
        console.log(this)
        console.log(`Hi, my name is ${this.name}`)
    },
    say: ()=>{
        console.log(this)
        console.log(`Hi, my name is ${this.name}`) // this.name => undefined
    },
    sayAsync: function(){
        // const _this = this
        // setTimeout(function(){
        //     console.log(_this.name)
        // }, 1100)

        setTimeout(()=>{
            console.log(this.name)
        }, 1100)
        
    }
}
person.sayHi()
// person.say()
person.sayAsync()